#include <string.h>
#include <screen.h>
#include <shell.h>

void echo (char * param)
{
	char * line;
	do
	{
		line = strsep (&param,"$(");
		if (line)
			kprintf ("%s", line);
		if (!param)
			break;
		line = strsep (&param,"(");
		line = strsep (&param,")");
		void * variable = GetVariable (line);
		if (variable)
		{
			if (GetVariableSize (line) == sizeof (uint32))
				kprintf ("%d",(uint32)variable);
			else
				kprintf ("%s",(char *)variable);
		}
	}
	while (param);
	
	kprintf ("\n");
}
